package com.itheima.method;

public class MethodDemo3 {
    public static void main(String[] args) {
        System.out.println(sums(2));
        judge(6);
    }
    public static int sums(int n) {
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum += i;
        }
        return sum;
    }
    public static void judge(int number){
        if (number % 2 == 1) {
            System.out.println(number + "是一个奇数");
        } else {
            System.out.println(number+"是一个偶数");
        }
    }

}
